# Copyright (c) Huawei Technologies Co., Ltd. 2024. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================

# 供 Tiling 链接的 Utils
#[[
#]]
add_library(ops_utils_tiling INTERFACE)
target_include_directories(ops_utils_tiling INTERFACE
        ${CMAKE_CURRENT_SOURCE_DIR}/inc
        # 头文件自包含, 包含 ops/utils/include 内头文件可引用的头文件路径
        ${ASCEND_DIR}/include
        ${ASCEND_DIR}/include/exe_graph
        ${OPENSDK_DIR}/include/metadef  # dfx_base.h -> error_manager.h, 解耦后删除
        ${OPENSDK_DIR}/include/slog     # dfx_base.h -> slog.h, 解耦后删除
)
target_compile_definitions(ops_utils_tiling INTERFACE
        OPS_UTILS_LOG_SUB_MOD_NAME="OP_TILING"  # 定义日志输出时 SUB_MODE 名称
)
target_link_libraries(ops_utils_tiling INTERFACE
        c_sec
        alog error_manager  # 日志
        exe_graph           # Context
)

# 供 Proto 链接的 Utils
#[[
#]]
add_library(ops_utils_proto INTERFACE)
target_include_directories(ops_utils_proto INTERFACE
        ${CMAKE_CURRENT_SOURCE_DIR}/inc
        # 头文件自包含, 包含 ops/utils/include 内头文件可引用的头文件路径
        ${ASCEND_DIR}/include
        ${ASCEND_DIR}/include/exe_graph
        ${OPENSDK_DIR}/include/metadef  # dfx_base.h -> error_manager.h
        ${OPENSDK_DIR}/include/slog  # dfx_base.h -> slog.h
)
target_compile_definitions(ops_utils_proto INTERFACE
        OPS_UTILS_LOG_SUB_MOD_NAME="OP_PROTO"
)
target_link_libraries(ops_utils_proto INTERFACE
        c_sec
        alog error_manager  # 日志
        exe_graph           # Context
)
